<?php

/**
 * Supplement form base class.
 *
 * @method Supplement getObject() Returns the current form's model object
 *
 * @package    rpgcom
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseSupplementForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idSupplement' => new sfWidgetFormInputHidden(),
      'name'         => new sfWidgetFormInputText(),
      'description'  => new sfWidgetFormTextarea(),
      'idSystem'     => new sfWidgetFormPropelChoice(array('model' => 'System', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'idSupplement' => new sfValidatorPropelChoice(array('model' => 'Supplement', 'column' => 'idSupplement', 'required' => false)),
      'name'         => new sfValidatorString(array('max_length' => 100)),
      'description'  => new sfValidatorString(),
      'idSystem'     => new sfValidatorPropelChoice(array('model' => 'System', 'column' => 'idSystem')),
    ));

    $this->widgetSchema->setNameFormat('supplement[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Supplement';
  }


}
